package com.secxiot.provider;

import com.secxiot.provider.task.vo.TaskDisplayVo;
import com.secxiot.provider.user.entity.SysExchangeRecord;
import com.secxiot.provider.user.entity.SysExchangeRules;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface IntegralApi {
    /**
     * 获取兑换规则
     *
     * @param userId
     * @return
     */
    @GetMapping("/getExchangeRules")
    List<SysExchangeRules> getExchangeRules(@RequestParam(value = "userId", required = true) Long userId);

    /**
     * 积分兑换
     *
     * @param userId          用户ID
     * @param integralNum     积分数量
     * @param exchangeRulesId 规则ID
     * @return
     */
    @PostMapping("/exchange")
    Integer integralExchange(
            @RequestParam(value = "userId", required = true) Long userId,
            @RequestParam(value = "integralNum", required = true) Long integralNum,
            @RequestParam(value = "exchangeRulesId", required = true) Long exchangeRulesId);


    /**
     * 获取兑换列表
     *
     * @param userId
     * @param pageNo
     * @param pageSize
     * @return
     */
    @GetMapping("/getExchangeRecordList")
    List<SysExchangeRecord> getExchangeRecordList(
            @RequestParam(value = "userId", required = true) Long userId,
            @RequestParam(value = "pageNo", required = true) Long pageNo,
            @RequestParam(value = "pageSize", required = true) Long pageSize
    );
}
